package com.bingxue.edu.management.education.model.query;

import com.bingxue.edu.common.enums.ChangeTypeEnum;
import com.bingxue.edu.common.enums.OperateSourceEnum;
import com.bingxue.edu.common.enums.OperateStatusEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDate;

@EqualsAndHashCode(callSuper = true)
@Data
@Schema(description = "退班退课查询条件")
public class ClassCancelQuery extends CommonClassQuery{

    @Schema(description = "学生id")
    private String studentId;

    @Schema(description = "变更类型类型")
    @NotNull(message = "变更类型不能为空")
    private ChangeTypeEnum changeType;

    @Schema(description = "申请方式")
    private OperateSourceEnum operateSource;

    @Schema(description = "操作状态")
    private OperateStatusEnum operateStatus;

    @Schema(description = "开始时间")
    private LocalDate createDateFrom;

    @Schema(description = "结束时间")
    private LocalDate createDateTo;

    public LocalDate getCreateDateTo() {
        return createDateTo == null ? null : createDateTo.plusDays(1);
    }
}
